XMLGeneric: fix case when input buffer of cdata may be fragged. Coalesce and return on the ending tag.
static void
coto_prepare_wpt_write(struct pdb *opdb)
{
+ struct appinfo *ai;
opdb->name[PDB_DBNAMELEN-1] = 0;
opdb->attributes = PDB_ATTR_BACKUP;
opdb->type = MYTYPEWPT;
opdb->appinfo_len = APPINFO_PACKED_SIZE;
opdb->appinfo = xcalloc(APPINFO_PACKED_SIZE,1);
- struct appinfo *ai = (struct appinfo *) opdb->appinfo;
+ ai = (struct appinfo *) opdb->appinfo;
ai->renamedCategories = 31; // Don't ask me why...
if (zerocat)
estr = (char *) cdatastr.mem + strlen(cdatastr.mem);
memcpy(estr, s, len);
estr[len] = 0;
-
- cb = xml_tbl_lookup(current_tag.mem, cb_cdata);
- if (cb) {
- (*cb)(estr, NULL);
- }
}
static void
if (strcmp(s + 1, el)) {
fprintf(stderr, "Mismatched tag %s\n", el);
}
+ cb = xml_tbl_lookup(current_tag.mem, cb_cdata);
+ if (cb) {
+ (*cb)( (char *) cdatastr.mem, NULL);
+ }
cb = xml_tbl_lookup(current_tag.mem, cb_end);
if (cb) {